package com.lifeibiao.作业0214;

public class HourlyEmployee extends ColaEmployee {
    private int salaryPerHour;//每小时的工资
    private int hoursPerMouth;//每月工作的小时数

    public double getSalary(int mouth){
        double mouthSalary = hoursPerMouth * salaryPerHour;
        if (hoursPerMouth > 160){
            mouthSalary += (hoursPerMouth - 160) * salaryPerHour * 1.5;
        }
        return mouthSalary + super.getSalary(mouth);
    }

    public HourlyEmployee(String emName, int emBirthday, int salaryPerHour, int hoursPerMouth) {
        super(emName, emBirthday);
        this.salaryPerHour = salaryPerHour;
        this.hoursPerMouth = hoursPerMouth;
    }

    public HourlyEmployee() {
    }

    public int getSalaryPerHour() {
        return salaryPerHour;
    }

    public void setSalaryPerHour(int salaryPerHour) {
        this.salaryPerHour = salaryPerHour;
    }

    public int getHoursPerMouth() {
        return hoursPerMouth;
    }

    public void setHoursPerMouth(int hoursPerMouth) {
        this.hoursPerMouth = hoursPerMouth;
    }
}
